<%--
  Created by IntelliJ IDEA.
  User: 陈俊雄
  Date: 2018/4/12
  Time: 14:34
--%>
<%@ page contentType="text/html;charset=UTF-8" %>
<!-- Main view -->
<div class="animated fadeInRight">
    <div class="wrapper wrapper-content ng-scope">
        <div class="row">
            <div class="col-lg-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>{{'REFUSED_STATISTICS' | translate}}：</h5>
                    </div>
                    <div class="ibox-content sk-loading" ng-controller="refusedStatisticsCtrl">
                        <div class="sk-spinner sk-spinner-wave">
                            <div class="sk-rect1"></div>
                            <div class="sk-rect2"></div>
                            <div class="sk-rect3"></div>
                            <div class="sk-rect4"></div>
                            <div class="sk-rect5"></div>
                        </div>
                        <form>
                            <div class="row">
                                <div class="col-sm-6 col-md-6 col-lg-1-5">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">商户号：</span>
                                            <select class="form-control b-r-sm" ng-model="searchInfo.merId"
                                                    ng-options="x.id as x.id + '(' + x.name + ')' for x in merchants">
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-sm-6 col-md-6 col-lg-1-5">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">域名：</span>
                                            <select class="form-control b-r-sm" ng-model="searchInfo.siteId"
                                                    ng-options="x.id as x.siteUrl for x in siteUrls">
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-sm-6 col-md-6 col-lg-1-5">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">国家：</span>
                                            <select class="form-control b-r-sm" ng-model="searchInfo.country">
                                                <option ng-repeat="x in country" ng-value="x.firstValue">{{x.name}}
                                                </option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-sm-6 col-md-6 col-lg-1-5">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">交易日期：</span>
                                            <input type="text" id="start_date" name="startDate"
                                                   uib-tooltip="可只选择起始日期查询起始日期至今订单"
                                                   class="form-control" ng-readonly="true"
                                                   ng-click="openDatepicker1()"
                                                   uib-datepicker-popup="{{format}}" ng-model="searchInfo.startDate"
                                                   is-open="popup1.opend"
                                                   datepicker-options="dateOptions1"
                                                   alt-input-formats="altInputFormats"
                                                   close-text="关闭" clear-text="清空" current-text="今天">
                                            <span class="input-group-btn">
                                                <button type="button" class="btn btn-default btn-sm no-margins"
                                                        ng-click="openDatepicker1()">
                                                    <i class="fa fa-calendar"></i>
                                                </button>
                                            </span>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-sm-6 col-md-6 col-lg-1-5">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">结束日期：</span>
                                            <input type="text" id="end_date" name="endDate"
                                                   class="form-control" ng-readonly="true"
                                                   ng-click="openDatepicker2()"
                                                   uib-datepicker-popup="{{format}}" ng-model="searchInfo.endDate"
                                                   is-open="popup2.opend"
                                                   datepicker-options="dateOptions2"
                                                   alt-input-formats="altInputFormats"
                                                   close-text="关闭" clear-text="清空" current-text="今天">
                                            <span class="input-group-btn">
                                                <button type="button" class="btn btn-default btn-sm no-margins"
                                                        ng-click="openDatepicker2()">
                                                    <i class="fa fa-calendar"></i>
                                                </button>
                                            </span>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-sm-6 col-md-6 col-lg-1-5">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">拒付日期：</span>
                                            <input type="text" id="refused_start_date" name="refusedStartDate"
                                                   uib-tooltip="可只选择起始日期查询起始日期至今订单"
                                                   class="form-control" ng-readonly="true"
                                                   ng-click="openDatepicker3()"
                                                   uib-datepicker-popup="{{format}}"
                                                   ng-model="searchInfo.refusedStartDate"
                                                   is-open="popup3.opend"
                                                   datepicker-options="dateOptions3"
                                                   alt-input-formats="altInputFormats"
                                                   close-text="关闭" clear-text="清空" current-text="今天">
                                            <span class="input-group-btn">
                                                <button type="button" class="btn btn-default btn-sm no-margins"
                                                        ng-click="openDatepicker3()">
                                                    <i class="fa fa-calendar"></i>
                                                </button>
                                            </span>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-sm-6 col-md-6 col-lg-1-5">
                                    <div class="form-group form-group-sm">
                                        <div class="input-group">
                                            <span class="input-group-addon">结束日期：</span>
                                            <input type="text" id="refused_end_date" name="refusedEndDate"
                                                   class="form-control" ng-readonly="true"
                                                   ng-click="openDatepicker4()"
                                                   uib-datepicker-popup="{{format}}"
                                                   ng-model="searchInfo.refusedEndDate"
                                                   is-open="popup4.opend"
                                                   datepicker-options="dateOptions4"
                                                   alt-input-formats="altInputFormats"
                                                   close-text="关闭" clear-text="清空" current-text="今天">
                                            <span class="input-group-btn">
                                                <button type="button" class="btn btn-default btn-sm no-margins"
                                                        ng-click="openDatepicker4()">
                                                    <i class="fa fa-calendar"></i>
                                                </button>
                                            </span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-6 col-md-6 col-lg-3 col-lg-offset-3">
                                    <button type="submit" class="btn btn-sm btn-w-m btn-primary pull-right"
                                            ng-click="search(searchInfo)">
                                        查询
                                    </button>
                                </div>
                                <div class="col-sm-6 col-md-6 col-lg-3">
                                    <button type="button" class="btn btn-sm btn-w-m btn-info"
                                            ng-click="resetForm()">
                                        重置
                                    </button>
                                </div>
                            </div>
                        </form>
                        <div class="hr-line-dashed"></div>
                        <%-- ng_table --%>
                        <div class="table-responsive">
                            <table ng-table="refusedTable"
                                   class="table table-condensed table-striped table-hover table-bordered">
                                <tr ng-repeat="row in $data">
                                    <td class="text-center col-lg-3 col-md-3 col-sm-3" sortable="'merName'"
                                        data-title="'商户号'">
                                        {{row.merId | getMerIdAndName : merchants}}
                                    </td>
                                    <td class="text-center" sortable="'count'" data-title="'交易总笔数'">
                                        {{row.count}}
                                    </td>
                                    <td class="text-center" sortable="'refusedCount'" data-title="'拒付总笔数'">
                                        {{row.refusedCount}}
                                    </td>
                                    <td class="text-center" sortable="'refusedEndDateRmbCount'" data-title="'拒付结束日期金额'"
                                        ng-if="showEndDateRmbCount">
                                        {{row.refusedEndDateRmbCount | currency : '¥'}}
                                    </td>
                                    <td class="text-center" sortable="'refusedRmbCount'" data-title="'拒付总金额'">
                                        {{row.refusedRmbCount | currency : '¥'}}
                                    </td>
                                    <td class="text-center" sortable="'refusePercent'" data-title="'拒付率'">
                                        {{row.refusePercent != null ? row.refusePercent + '%' : null}}
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <my-pagination table-param="refusedTable"></my-pagination>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
